package com.itheima.pattern.factory.before;

// 咖啡店类
public class CoffeeStore {
    public Coffee orderCoffee(String type) {
        Coffee coffee = null;

        if ("american".equals(type)) {
            coffee = new AmericanCoffee();
        } else if ("latte".equals(type)) {
            coffee = new LatteCoffee();
        } else {
            System.out.println("没有该咖啡");
        }

        coffee.addSugar();
        coffee.addMilk();

        return coffee;
    }
}
